import pymysql

# 建立数据库连接
con = pymysql.Connect(host='localhost',port=3306,user='root',password='',database='agileone',charset='utf8')
#创建游标
cursor = con.cursor()
#执行sql语句
cursor.execute("select * from notice where noticeid='2'")
#获取查询的结果
result=cursor.fetchall()
print(result)
print(result[0][0])
noticeid = result[0][0]
headline = result[0][1]
content = result[0][2]
